import Mock from 'mockjs'

// 图表数据
let list = []
export default {
    getStaticalData: () => {
        // Mock.Random.float产生随机数100到8000之间，保留小数，最小0位，最大0位
        for (let i = 0; i < 7; i++) {
            list.push(
                Mock.mock({
                    '苹果': Mock.Random.float(100, 8000, 0, 0),
                    'vivo': Mock.Random.float(100, 8000, 0, 0),
                    'oppo': Mock.Random.float(100, 8000, 0, 0),
                    '魅族': Mock.Random.float(100, 8000, 0, 0),
                    '三星': Mock.Random.float(100, 8000, 0, 0),
                    '小米': Mock.Random.float(100, 8000, 0, 0),
                })
            )
        }
        return {
            code: 20000, /*状态码*/
            data: {
                // 饼图
                videoData: [
                    {name: '苹果', value: 2999},
                    {name: 'vivo', value: 2999},
                    {name: 'oppo', value: 2999},
                    {name: '魅族', value: 2999},
                    {name: '三星', value: 2999},
                    {name: '小米', value: 2999},
                ],
                // 柱状图
                userData: [
                    {data: '周一', new: 5, active: 200},
                    {data: '周二', new: 5, active: 200},
                    {data: '周三', new: 5, active: 200},
                    {data: '周四', new: 5, active: 200},
                    {data: '周五', new: 5, active: 200},
                    {data: '周六', new: 5, active: 200},
                    {data: '周日', new: 5, active: 200},
                ],
                // 折线图
                orderData: {
                    date: ['20191001', '20191002', '20191003', '20191004', '20191005', '20191006', '20191007',],
                    data: list
                },
                // 表格数据
                tableData: [
                    {name: 'oppo', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: 'vivo', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: '苹果', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: '小米', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: '三星', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: '魅族', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: '华为', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: '康师傅', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: '农夫山泉', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                    {name: '猪猪侠', todayBuy: 100, monthBuy: 300, totalBuy: 800},
                ],
                // 账单数据
                countData: [
                    {id: 1, name: '今日支付订单', value: 1234, icon: 'success', color: '#2ec7c9'},
                    {id: 2, name: '今日收藏订单', value: 1234, icon: 'success', color: '#1abc9c'},
                    {id: 3, name: '今日未支付订单', value: 1234, icon: 'success', color: '#2ecc71'},
                    {id: 4, name: '今日退款订单', value: 1234, icon: 'success', color: '#e67e22'},
                    {id: 5, name: '今日退款订单', value: 1234, icon: 'success', color: '#e67e22'},
                    {id: 6, name: '今日退款订单', value: 1234, icon: 'success', color: '#e67e22'},
                ]
            }
        }
    }
}
